package cn.edu.just.firstjavaapp.l5;

public class PointV2 {
    private int x;
    private int y;

    public PointV2() {
        //int a = 100;
        this(10,10);  //必须是第一句
    }

    public PointV2(int x, int y) {
        this.x = x;
        this.y = y;
    }

    public int getX() {
        
        return x;
    }

    public int getY() {
        return y;
    }

    public PointV2 setX(int x) {
        this.x = x;
        return this;
    }

    public PointV2 setY(int y) {
        this.y = y;
        return this;
    }

    public void print(){
        System.out.println("("+x+","+y+")");
    }

    public static void main(String[] args) {
        PointV2 pt = new PointV2();

        pt.setX(200).setY(33);
        pt.print();

    }
}
